#ifndef MINI_H
#define MINI_H

#include <QtWidgets>
#include <qwidgetresizehandler_p.h>
#include "cqButton.h"
#include "cqplayer.h"

class CQPlayer;

class miniwindow : public QWidget{

	Q_OBJECT

public:

	miniwindow(QWidget *parent = 0);
	~miniwindow();

	void CQ_Set_Parent(CQPlayer *parent);
	void CQ_Init_Play_Mode(int vol);

private slots:

	void cq_back_to_main();

	void cq_next_music();

	void cq_last_music();

	void cq_play();

	void cq_pause();

	void cq_set_mode();

	void cq_exit();

	void cq_lyric_action();
	
	void cq_update_vol(int);
private:

	void paintEvent(QPaintEvent *event);
	void contextMenuEvent(QContextMenuEvent *event);

	void cq_init_menu_actions();
	
	CQPushButton *playButton;
	CQPushButton *pauseButton;
	CQPushButton *miniNextButton;

	QMenu *contextMenu;
	QActionGroup *modeGroup;
	
	QAction *mode0;
	QAction *mode1;
	QAction *mode2;
	QAction *mode3;
	QAction *mainForm;
	QAction *exit;
	QAction *next;
	QAction *last;
	QAction *lyric;
	QWidgetAction *setVolumn;
	QSlider *volSlider;

	CQPlayer *parentForm;

};

#endif